import request from '/@/utils/request';

// 上传
// fileCode: 产品图-product 产品视频-productVideo 内容-content
// file
export const upload = (data: any) => {
	return request({
		url: '/common/upload',
		method: 'post',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
		data,
	});
};

// 获取城市列表
export const getCityList = (data?: any) => {
	return request({
		url: '/common/areaList',
		method: 'post',
		data,
	});
};

// 获取用户信息
export const fetchUserInfo = () => {
	return request({
		url: '/sys/user/info',
		method: 'get',
	});
};

// 获取全部菜单
export const getEmnuList = (data: any) => {
	return request({
		url: '/common/menu/list',
		method: 'post',
		data,
	});
};

// 下载文件
export const downloadFile = (params: any) => {
	return request({
		url: '/common/file/excel/download',
		method: 'get',
		responseType: 'blob',
		params,
	});
};
